https://leetcode.cn/problems/climbing-stairs/submissions/

class Solution70 {
    public int climbStairs(int n) {
        if(n == 1) return 1;
        if(n == 2) return 2;
        int result = 0;
        int pre = 2;
        int prepre = 1;
        for(int i = 3; i <= n; ++i){
            result = pre + prepre;
            prepre = pre;
            pre = result;
        }
        return result;
    }
}